<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>登录页面</title>
<link type="text/css" rel="stylesheet" href="css/login.css" />
</head>
<body>
<div id="wrapper">
  <div id="top"><img src="i/logo.png" width="100" height="50" alt="中软国际" />
    <h1>中国现代化支付系统</h1>
    <h2>| 登录</h2>
    <div id="top_right"><span id="index"><a href="login.jsp">首页</a><a href="#" onclick="beginSend();">报文发送端</a></span> </div>
    <div class="clear"></div>
  </div>
  <div id="main">
    <div id="main_right"><span>管理员登录</span> <span id="reg"><a href="#">找回密码</a></span>|<span id="active"><a href="#">账户激活</a></span>
      <div id="login_box">
        <form id="login" name="login" method="post" onsubmit="return true;" action="/cnaps/login!login.do">
          <table>
            <tr>
              <td align="right"><label for="username">账户名:</label></td>
              <td colspan="2">
              <input type="text" name="username" id="username" value=""/>
              <br>
 			  <span id="usernameshow"></span>
              </td>
            </tr>
            <tr>
              <td align="right"><label for="password">登录密码:</label></td>
              <td colspan="2">
              <input type="password" name="password" id="password" />
              <br><span id="passwordshow"></span>
              </td>
            </tr>

            <tr>
              <td align="right"><label for="checkNum">验证码:</label></td>
              <td colspan="2"><input type="text" name="irand" size="10">
              <br><span id="irandshow"></span>
              </td>
            </tr>
            <tr class="thiner">
              <td align="right">&nbsp;</td>
              <td colspan="2"><span>请输入下图内容,不区分大小写</span></td>
            </tr>
            <tr>
              <td align="right"><label for="checkNum"></label></td>
              <td colspan="2"><img id="irandImg" src="image.jsp"/>
              <a href="javascript:void(0);" onclick="changeIrand();"/>换一张</a></td>
              <td ></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td colspan="2"></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td><input type="submit" src="i/login_btn.jpg" value="登录" /></td>
              <td>&nbsp;</td>
            </tr>
          </table>
        </form>
      </div>
    </div>
    <div class="clear"></div>
  </div>
  <iframe src="footer.html" width="100%" height="55px" scrolling="no" frameborder="0"></iframe>
</div>
</body>
 <script type="text/javascript">
 	      innelt();
 		  
          function changeIrand(){
                document.getElementById("irandImg").src = "image.jsp?k="+Math.random();  
                //document.getElementById("irandImg").src = "image.jsp";  
          }
          
          //验证初始化
          function innelt(){
          	var loginResult = '${loginResult}';
          	if(loginResult==-1){
          		document.getElementById("usernameshow").innerHTML="该账户不存在！";
          	}else if(loginResult==-2){
          		document.getElementById("passwordshow").innerHTML="密码错误！";
          		document.getElementById("username").value="${username}";
          	}else if(loginResult==-3){
          		document.getElementById("irandshow").innerHTML="验证码错误！";
          		document.getElementById("username").value="${username}";
          		document.getElementById("password").value="${password}";
          	}
          }
          
          function beginSend(){
          	login.action="/cnaps/cmt!cmtFrame.do";
          	login.submit();
          }
 </script>
</html>
